<div class="anchor-tab">
    <ul class="tab">
        <li class="on"><a href="/member/family/income">公会收入</a></li>
        <li><a href="/member/family/anchor">公会艺人</a></li>
        <!--<li><a href="/member/family/anchor_income">艺人收入</a></li>-->
        <!--<li><a href="/member/family/anchor_salary">基本工资</a></li>-->
        <li><a href="/member/family/anchor_live">直播数据</a></li>
    </ul>
</div>
<div class="anchor-cont">
    <div class="tabs-cont">
        <div class="hander-func">
            <span style="font-size: 16px;color:red;">公会ID:&nbsp;</span><span style="font-size: 16px;color:red;" id="J_Family_Income_ID"></span>
            <p class="fr" style="margin-left: 20px;">双旦活动金豆总收入：<em class="c-orange" id="J_MyFamily_AndGuo"></em></p>
        </div>
        <div class="tableinfo">
            <table class="tabinfo">
                <thead>
                <tr>
                    <th>月份</th>
                    <th>艺人金豆收入(元)</th>
                    <th>公会提成</th>
                    <th>公会收入(元)</th>
                    <th>税点(30%)</th>
                    <th>实际收入(元)</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="J_OrderList">
                <tr>
                    <td colspan="7">加载中...</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="AjaxPagination" class="pagination"></div>
        <div class="intro_tip">
            <h3>温馨提示：</h3>
            <p>1.次月3日打款到账，遇节假日延顺</p>
            <p>2.提现转账手续费由公会承担，到账款项可能小于实际收入</p>
        </div>
    </div>
</div>
<script>
    $(function () {
        $('#J_Family_Income_ID').html(_StateData.Family.Family_ID);
        $('#J_MyFamily_AndGuo').empty().text(_PageData.Beans ? _PageData.Beans : 0);
        $.ajax({
            url: '/ajaxs/report.family-month.list',
            type: 'post',
            dataType: 'json',
            data: {},
            success: function (data) {
                if (data.flag != 0) {
                    $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 3000});
                    return;
                }
                var _html = '';
                if (data.data.length <= 0) {
                    _html = RenderPage(null, data.data.length);
                    $('#J_OrderList').empty().html(_html);
                    return;
                }
                _.forEach(data.data, function (ThisValue) {
                    _html += RenderPage(ThisValue, data.data.length);
                });
                $('#J_OrderList').empty().html(_html);
            }
        })
        function RenderPage(ThisValue, len) {
            var _html = '';
            if (len <= 0) {
                _html += '<tr>' +
                        '<td colspan="7">' + '暂无数据！' +
                        '</td>' +
                        '</tr>';
            } else {
                var a_href = '<a href="javascript:;" class="c-button fr" OpenWindow=":FamilyIncomeInfo:' + moment(ThisValue.Report_Day).format('YYYY-MM') + '">明细</a>';
                _html += '<tr>' +
                        '<td>' + moment(ThisValue.Report_Day).format('YYYY-MM') +
                        '</td>' +
                        '<td>' + Math.floor(ThisValue.Beans_Anchor_Task / 1000 * 100) / 100 +
                        '</td>' +
                        '<td>' + 0.2 +
                        '</td>' +
                        '<td>' + Math.floor(ThisValue.Beans_Anchor_Task / 1000 * 0.2 * 100) / 100 +
                        '</td>' +
                        '<td>' + Math.floor(ThisValue.Beans_Anchor_Task / 1000 * 0.2 * 0.03 * 100) / 100 +
                        '</td>' +
                        '<td>' + Math.floor((ThisValue.Beans_Anchor_Task * 0.2 - ThisValue.Beans_Anchor_Task * 0.2 * 0.03) / 1000 * 100) / 100 +
                        '</td>' +
                        '<td>' + a_href +
                        '</td>' +
                        '</tr>';
            }
            return _html;
        }
    })
</script>